package crm.sfh.server;

import android.content.Context;

import cn.bmob.v3.BmobObject;
import cn.bmob.v3.listener.UpdateListener;
import crm.sfh.server.entity.ENote;

/**
 * Created by Administrator on 2018/2/28.
 */

public class SNote extends BmobObject {


    /**
     * 社团ID
     */
    String massId;

    /**
     * 发布者
     */
    SUser author;

    /**
     * 0 文字 1 图片 2录音 3动图 4视频
     */
    Integer type;

    /**
     * 文字内容
     */
    String title;

    /**
     * 标签
     */
    String lable;

    /**
     * 阅览次数
     */
    Long sizeReading;

    /**
     * 点赞次数
     */
    Long sizeFabulous;

    /**
     * 留言次数
     */
    Long sizeMessage;

    /**
     * 回复时间
     */
    String replyTime;

    /**
     * 图片内容
     */
    String content;
    /**
     * 前三个留言
     */
    SMessage fristMsg;
    SMessage twoMsg;
    SMessage threeMsg;

    /*城市*/
    String city;

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getMassId() {
        return massId;
    }

    public void setMassId(String massId) {
        this.massId = massId;
    }

    public SUser getAuthor() {
        return author;
    }

    public void setAuthor(SUser author) {
        this.author = author;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLable() {
        return lable;
    }

    public void setLable(String lable) {
        this.lable = lable;
    }

    public Long getSizeReading() {
        return sizeReading;
    }

    public void setSizeReading(Long sizeReading) {
        this.sizeReading = sizeReading;
    }

    public Long getSizeFabulous() {
        return sizeFabulous;
    }

    public void setSizeFabulous(Long sizeFabulous) {
        this.sizeFabulous = sizeFabulous;
    }

    public Long getSizeMessage() {
        return sizeMessage;
    }

    public void setSizeMessage(Long sizeMessage) {
        this.sizeMessage = sizeMessage;
    }

    public String getReplyTime() {
        return replyTime;
    }

    public void setReplyTime(String replyTime) {
        this.replyTime = replyTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public SMessage getFristMsg() {
        return fristMsg;
    }

    public void setFristMsg(SMessage fristMsg) {
        this.fristMsg = fristMsg;
    }

    public SMessage getTwoMsg() {
        return twoMsg;
    }

    public void setTwoMsg(SMessage twoMsg) {
        this.twoMsg = twoMsg;
    }

    public SMessage getThreeMsg() {
        return threeMsg;
    }

    public void setThreeMsg(SMessage threeMsg) {
        this.threeMsg = threeMsg;
    }

    public ENote getENote() {
        ENote note = new ENote();
        note.setAuthor(author.getUser());
        note.setContent(content);
        note.setLable(lable);
        note.setMassId(massId);
        note.setNoteId(getObjectId());
        note.setReplyTime(replyTime);
        note.setSizeFabulous(sizeFabulous);
        note.setSizeMessage(sizeMessage);
        note.setSizeReading(sizeReading);
        note.setTitle(title);
        note.setType(type);
        note.setFristMsg(fristMsg == null ? null : fristMsg.getEMessage());
        note.setTwoMsg(twoMsg == null ? null : twoMsg.getEMessage());
        note.setThreeMsg(threeMsg == null ? null : threeMsg.getEMessage());
        note.setCreateTime(getCreatedAt());
        return note;
    }
}
